<template>
  <div>
    <button @click="sent">发送请求</button>
    <span>{{ t('app.sent') }}</span>
    <button @click="change">修改</button>
  </div>
</template>

<script setup>
import add from '@/add'
import mul from '@com/mul'
import axios from 'axios'
import useLangstore from './store'
import { useI18n } from 'vue-i18n'
const { t, locale } = useI18n()
const Langstore = useLangstore()
// 获取环境变量
console.log(import.meta.env.VITE_API_URL)
console.log(add(1, 2));
console.log(mul(8, 8));
const sent = async () => {
  let data = await axios.get('/server/music')
  console.log(data);

}
const change = () => {
  let result = locale.value === 'zh' ? 'en' : 'zh'
  locale.value = result
  Langstore.changelangFn(result)
}

</script>

<style lang="scss" scoped></style>